﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrokerBase.Lib.Core;
using BrokerBase.Lib.Person;

namespace BrokerBase.Lib.Policy
{
    /// <summary>
    /// 保单方案
    /// </summary>
    public interface IScheme:IPK,ICheck
    {
        /// <summary>
        /// 编号
        /// </summary>
        string Number { get; set; }
        /// <summary>
        /// 期间
        /// </summary>
        int PeriodRange { get; set; }
        /// <summary>
        /// 业务时间
        /// </summary>
        DateTime BizDate { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        DateTime CreateDate { get; set; }
        /// <summary>
        /// 投保人
        /// </summary>
        IPerson Holder { get; set; }
        /// <summary>
        /// 被报人
        /// </summary>
        IPerson Insurant { get; set; }

        /// <summary>
        /// 投保人性别
        /// </summary>
        SexType HolderSex { get; set; }
        /// <summary>
        /// 投保人年龄
        /// </summary>
        int HolderAge { get; set; }
        /// <summary>
        /// 被保人性别
        /// </summary>
        SexType InsurantSex { get; set; }
        /// <summary>
        /// 被保人年龄
        /// </summary>
        int InsurantAge { get; set; }

        /// <summary>
        /// 受益人
        /// </summary>
        IPerson Beneficiary { get; set; }
        /// <summary>
        /// 保单集合
        /// </summary>
        IList<IPolicy> Policies { get; }

        /// <summary>
        /// 通过保单名称获得一个保单
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        IPolicy GetPolicy(string name);

        //IPolicyLight GetPolicyLight(string name);

        /// <summary>
        /// 主险
        /// </summary>
        IPolicy BasicPolicy { get; }
        /// <summary>
        /// 付款计划
        /// </summary>
        IList<IPlanPayPeriod> PlanPayPeriods { get; set; }
        /// <summary>
        /// 创建付款计划
        /// </summary>
        /// <returns></returns>
        void CalcPayPeriods();
        /// <summary>
        /// 保费
        /// </summary>
        double Fee { get; }

        int GetPeriodCount(int defaultMaxAge);

        int MaxProtectPeriod { get; }

        int MaxPaymentPeriod { get; }

        /// <summary>
        /// 其它保单
        /// </summary>
        IList<IPolicyLight> PolicyLights { get; set; }

        IPolicyLight BasicPolicyLight { get; }

        string Description { get; set; }
        
    }
}
